﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
dim urls,Page,PageSize,vipd
urls=Request.QueryString("urls")
if urls="" then urls="fainfo.asp"
	PageSize=8

	dim rs,sql,i
    	act = Request.QueryString("act")      '当前页数
    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1
		if sid<>"Null" then
select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
Randomize()
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><anchor>页<go href='fainfo.asp?id="&id&"&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>"
%>
<card title="我的发件箱"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we2="</div>"
book=""&dao&"<form action=""fainfo.asp?id="&id&"&amp;sid="&sidd&"&run="& Int((9999) * Rnd() + 1) &""" method=""post"">跳到第<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""页"" /></form>"&we0&""
%>
<title>我的发件箱</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select
		qingtian.info
if qingtian.vip(qingtian.nid)="VIP会员" then 
vipd=100
else
vipd=40
end if
%>		
<%=qingtian.qingsav("104")%><%=dao%>发件箱(容量<%=zi%><%=vipd%><%=zi0%>)-<a href="ininfo.asp?sid=<%=sidd%>">收件箱</a><%=we0%><%=sou%>提示:请不要随意清空发件箱的信息!<%=we0%><%=hr%>   
		<%

	Set Rs = Server.CreateObject("Adodb.Recordset")
if act=1 then
Sql = "select [time] from [qingtian_info]  where [nid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"')"
			Rs.Open Sql,conn,1,3
			if not (rs.bof and rs.eof)  then
				For i=1 to rs.RecordCount
					If Rs.Eof Then
						exit For
					End If
                                if day(rs("time"))<>day(now()) then
					rs.delete
                                end if
					Rs.MoveNext
				Next
			end if
			Rs.close
%><%=we%>你还没有发送任何信件,你发送的信件已经全部清空!<%=we0%><%

else

	Sql = "select [id],[name],[ok],[isok],[time] from [qingtian_info]  where [nid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"') order by [time]  desc"
	Rs.Open Sql,conn,1,1


	if not (rs.bof and rs.eof)  then
				Rs.PageSize = PageSize	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage

if vipd=100 and rs.RecordCount>100  then
qingtian.delinfoo "0","100"
elseif vipd=40 and rs.RecordCount>40  then
qingtian.delinfoo "0","40"
end if

		For i=1 to Rs.PageSize

			If Rs.Eof Then
				exit For
			End If
		%><%=we%><b><%=i+(page-1)*PageSize%></b>.<%if rs("ok")=1 then%><b>[已发送]</b><%else%><b>[未发送]</b><%end if%><br/><%=zi%><%if rs("isok")=1 then%>[未阅]<%else%>[已阅]<%end if%><%=zi0%><a href="vieinfo.asp?id=<%=rs("id")%>&amp;pageid=<%=page%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>"><%=qingtian.ubb(rs("name"))%></a><%=we0%><%=sou%>[<%=rs("time")%>]<%=we0%><%
		Rs.MoveNext
		Next
%>
<%=we%><a href="instr.asp?act=2&amp;sid=<%=sidd%>&amp;urls=<%=urls%>">=清空所有内线=</a><%=we0%>
<%  
       
   		if rs.PageCount >1 then
     		    Response.Write sou
    		End If
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='fainfo.asp?page=" & Page + 1 & "&amp;sid="&sidd&"&amp;urls=" & urls & "'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='fainfo.asp?page=" & Page - 1 & "&amp;sid="&sidd&"&amp;urls=" & urls & "'>上一页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write(""&we0&"")
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
   %>
		<%=book%>
		<%
    		Response.Write(""&we&"(第" & Page & "/总" & rs.PageCount & "页/" & rs.RecordCount & "条)"&we0&"")
    		End If
                                                                


	else
		%><%=we%>你还没有发送任何信件!<%=we0%><%
	end if
	Rs.close
	set rs=nothing
end if

		%>
<%=hr%><%=sou%><a href="caoinfo.asp?sid=<%=sidd%>">返回草稿箱</a><%=we0%>
<%=qingtian.qingsav("105")%>
<%

		else
			Response.Redirect "/login.asp?sid=" & sidd & "&url=fainfo.asp?sid="&sidd&"@@urls="&urls

		end if


end Function%>
